<?php
declare (strict_types=1);

namespace app\controller;

use app\helpers\api\ApiResponse;
use think\Request;

class UploadController
{
    use ApiResponse;

    public function upload(Request $request)
    {
        $file = request()->file('image');
        // 上传到本地服务器
        $savename = \think\facade\Filesystem::disk('public')->putFile( 'image', $file);
        return $this->success('/storage/'.$savename);
    }
}
